package resoft.jeasyform.util;

import resoft.jeasyform.core.LayoutReader;

/**
 * <p></p>
 * User: albert
 * Date: Aug 30, 2007
 * Time: 2:54:05 PM
 */
public class LayoutUtil {
    public static LayoutReader getLayoutReader() {
        String readerClassName = System.getProperty("LayoutReaderClass");
        if (readerClassName == null || readerClassName.equals("")) {
            readerClassName = "resoft.jeasyform.impl.XmlLayoutReader";
        }
        LayoutReader reader = (LayoutReader) ClassUtil.newInstance(readerClassName);
        if (reader == null) {
            throw new RuntimeException("LayoutReader can't be loaded:" + readerClassName);
        }
        return reader;
    }
}
